
@extends('admin.common.common')

@section('head')

@endsection


@section('body')

    <article class="page-container">
        <form class="form form-horizontal" id="form-role-add" action="{{route('admin.role.update',$role)}}" method="post" enctype="multipart/form-data">
            @method('put')
            @csrf
        @if ($errors->any())
                <div class="Huialert-error Huialert">
                    <ul>
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
            @endif
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>角色名称：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="{{$role->rolename}}" placeholder="" id="rolename" name="rolename">
                </div>
            </div>

            <div class="row cl">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                    <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                </div>
            </div>
        </form>
    </article>
@endsection


@section('js')
    <script src="/admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
    <script  src="/admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>

    <script>
        $('#form-role-add').validate({
            rules: {
                rolename:{
                    required:true,
                },
            },
            onkeyup:false,
            focusCleanup: true,
            success:"valid",
            submitHandler:function (form) {

                //表单的提交方式
                form.submit();
            }
        })
    </script>

@endsection
